package com.real8.plusplayground.client;

import com.google.api.gwt.services.plus.shared.Plus;
import com.google.gwt.place.shared.PlaceController;
import com.google.web.bindery.event.shared.EventBus;
import com.google.web.bindery.requestfactory.shared.Receiver;
import com.google.web.bindery.requestfactory.shared.RequestFactory;
import com.real8.plusplayground.client.activity.ActivityReadView;
import com.real8.plusplayground.client.menu.MenuView;
import com.real8.plusplayground.client.person.PersonView;
import com.real8.plusplayground.client.shell.PlusPlaygroundShellView;
import com.real8.plusplayground.client.statistics.StatisticsView;

public interface ClientFactory {
	/**
	 * Get application constants
	 * 
	 * @return
	 */
	AppConstants getAppConstants();

	/**
	 * Create the App.
	 * 
	 * @return a new instance of the {@link App}
	 */
	App getApp();

	/**
	 * Get the {@link EventBus}
	 * 
	 * @return the event bus used through the app
	 */
	EventBus getEventBus();

	/**
	 * Get the {@link PlaceController}.
	 * 
	 * @return the place controller
	 */
	PlaceController getPlaceController();

	/**
	 * Login user
	 * 
	 * @param accessTokenReceiver
	 */
	void login(Receiver<String> accessTokenReceiver);

	/**
	 * Get (latest created) G+ {@link RequestFactory} {@link Plus}
	 * 
	 * @return
	 */
	Plus getPlus();

	/**
	 * Create, initialize and get a new (anonymous) G+ {@link RequestFactory}
	 * {@link Plus}.
	 * 
	 * @param receiver
	 */
	void createNewPlus(Receiver<Plus> receiver);

	/**
	 * Create, initialize and get a new G+ {@link RequestFactory} {@link Plus}
	 * using a users authorization token.
	 * 
	 * @param authorizationToken
	 * @param receiver
	 */
	void createNewPlus(String authorizationToken, Receiver<Plus> receiver);

	/**
	 * Get the UI shell.
	 * 
	 * @return the shell
	 */
	PlusPlaygroundShellView getShell();

	/**
	 * Get an implementation of {@link MenuView}.
	 */
	MenuView getMenuView();

	/**
	 * Get an implementation of {@link ActivityReadView}.
	 */
	ActivityReadView getActivityReadView();

	/**
	 * Get an implementation of {@link PersonView}.
	 */
	PersonView getPersonView();

	/**
	 * Get an implementation of {@link StatisticsView}.
	 * 
	 * @return
	 */
	StatisticsView getStatisticsView();
}
